<!DOCTYPE HTML>
<html>
<head>
<title>IfMsgBox | AutoHotkey</title>
<meta name="description" content="The IfMsgBox statement checks which button was pushed by the user during the most recent MsgBox command." />
<meta name="ahk:equiv-v2" content="commands/MsgBox.htm#Result" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>IfMsgBox</h1>

<p>检查用户在最近的 <a href="MsgBox.htm">MsgBox</a> 命令中点击了哪个按钮.</p>

<pre class="Syntax"><span class="func">IfMsgBox</span>, ButtonName</pre>
<h2>参数</h2>
<dl>

  <dt>ButtonName</dt>
  <dd><p>下列字符串之一表示用户在最近的 <a href="MsgBox.htm">MsgBox</a> 命令中所点击的按钮:</p>
      <p>Yes(是)<br>No(否)<br>OK(确认)<br>Cancel(取消)<br>Abort(终止)<br>Ignore(忽略)<br>Retry(重试)<br>Continue(继续)<span class="ver">[v1.0.44.08+]</span><br>TryAgain(重试)<span class="ver">[v1.0.44.08+]</span><br>Timeout(即单词 "timeout" 表示 MsgBox 命令<a href="MsgBox.htm#Timeout">超时</a>)</p>
    </dd>

</dl>

<h2>相关</h2>
<p><a href="MsgBox.htm">MsgBox</a></p>
<h2>示例</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>MsgBox, 4, , Would you like to continue?, 5  <em>; 5 秒的超时时间.</em>
IfMsgBox, No
    Return  <em>; 用户点击了 "No" 按钮.</em>
IfMsgBox, Timeout
    Return <em>; 即在超时时假设点击了 "No".
; 否则, 继续:</em>
<em>; ...</em></pre>
</div>

</body>
</html>